#import json
rm /etc/yum.repos.d/*.repo

#set $repo_setup = json.loads($getVar("repo_setup"))
#set $repos = $repo_setup["repos"]
#for $repo in $repos
cat > /etc/yum.repos.d/${repo["name"]}.repo << EOF
[${repo["name"]}]
name=$repo["name"]
baseurl=$repo["uri"]
gpgcheck=0
#if $repo.get("priority")
priority=$repo["priority"]
#end if
EOF
#end for
